# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.CertificateManager.V1.Model.DnsAuthorization do
  @moduledoc """
  A DnsAuthorization resource describes a way to perform domain authorization for certificate issuance.

  ## Attributes

  *   `createTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The creation timestamp of a DnsAuthorization.
  *   `description` (*type:* `String.t`, *default:* `nil`) - Optional. One or more paragraphs of text description of a DnsAuthorization.
  *   `dnsResourceRecord` (*type:* `GoogleApi.CertificateManager.V1.Model.DnsResourceRecord.t`, *default:* `nil`) - Output only. DNS Resource Record that needs to be added to DNS configuration.
  *   `domain` (*type:* `String.t`, *default:* `nil`) - Required. Immutable. A domain that is being authorized. A DnsAuthorization resource covers a single domain and its wildcard, e.g. authorization for `example.com` can be used to issue certificates for `example.com` and `*.example.com`.
  *   `labels` (*type:* `map()`, *default:* `nil`) - Optional. Set of labels associated with a DnsAuthorization.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Identifier. A user-defined name of the dns authorization. DnsAuthorization names must be unique globally and match pattern `projects/*/locations/*/dnsAuthorizations/*`.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Optional. Immutable. Type of DnsAuthorization. If unset during resource creation the following default will be used: - in location `global`: FIXED_RECORD, - in other locations: PER_PROJECT_RECORD.
  *   `updateTime` (*type:* `DateTime.t`, *default:* `nil`) - Output only. The last update timestamp of a DnsAuthorization.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :createTime => DateTime.t() | nil,
          :description => String.t() | nil,
          :dnsResourceRecord => GoogleApi.CertificateManager.V1.Model.DnsResourceRecord.t() | nil,
          :domain => String.t() | nil,
          :labels => map() | nil,
          :name => String.t() | nil,
          :type => String.t() | nil,
          :updateTime => DateTime.t() | nil
        }

  field(:createTime, as: DateTime)
  field(:description)
  field(:dnsResourceRecord, as: GoogleApi.CertificateManager.V1.Model.DnsResourceRecord)
  field(:domain)
  field(:labels, type: :map)
  field(:name)
  field(:type)
  field(:updateTime, as: DateTime)
end

defimpl Poison.Decoder, for: GoogleApi.CertificateManager.V1.Model.DnsAuthorization do
  def decode(value, options) do
    GoogleApi.CertificateManager.V1.Model.DnsAuthorization.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.CertificateManager.V1.Model.DnsAuthorization do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
